Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: include newer versions of languagetool in tests #126

Merged

Conversation

Rolv-Apneseth
Copy link
Collaborator

Just adding in the newer versions as requested. Hopefully we can also use this branch for figuring out why the tests for the latest version was/is failing

@Rolv-Apneseth
Copy link
Collaborator Author

I can't reproduce the failing test by running the docker image locally so I added some minor code for outputting the errors.

By the way, what do you think about throwing in a docker-compose.yml file into the repo for easier self-hosting of the API?

@Rolv-Apneseth
Copy link
Collaborator Author

Hmm - this time 6.5 and latest passed. Any clue why?

Copy link

codspeed-hq bot commented Nov 16, 2024

CodSpeed Performance Report

Merging #126 will not alter performance

Comparing Rolv-Apneseth:test-later-languagetool-versions (4838e40) with v3 (a90bd15)

Summary

✅ 6 untouched benchmarks

@jeertmans
Copy link
Owner

Looks good! Failing checks are not relevant for this PR :-)

@jeertmans
Copy link
Owner

Hmm - this time 6.5 and latest passed. Any clue why?

No clue, but there is no reason why it should fail (the exception is that LT could change detect new errors that were not covered before, which could break our tests, but not the API itself). LT hasn't changed its API in almost two years, I think.

@jeertmans
Copy link
Owner

I can't reproduce the failing test by running the docker image locally so I added some minor code for outputting the errors.

By the way, what do you think about throwing in a docker-compose.yml file into the repo for easier self-hosting of the API?

I rarely use Docker, but I am open to better / more reproducible ways to self-host a server. The current ltrs docker commands are quite simple, and probably not bulletproof.

@jeertmans jeertmans merged commit ccb494a into jeertmans:v3 Nov 16, 2024
21 of 23 checks passed
@jeertmans jeertmans added the ci Continuous Integration related (GitHub actions, precommit, …) label Nov 16, 2024
@Rolv-Apneseth
Copy link
Collaborator Author

I rarely use Docker, but I am open to better / more reproducible ways to self-host a server. The current ltrs docker commands are quite simple, and probably not bulletproof.

Probably not be necessary, I'm just a big fan of docker compose due to the declarative style. I can just define everything that's needed from a single yaml. I'll just leave the content here for future reference in case (I'll probably come back to find this):

version: "3"

services:
  languagetool:
      image: erikvl87/languagetool:latest
      ports:
      - 8010:8010
      environment:
      - langtool_languageModel=/ngrams
      - Java_Xms=512m
      - Java_Xmx=1g
      volumes:
      - ./data:/ngrams

@Rolv-Apneseth Rolv-Apneseth deleted the test-later-languagetool-versions branch November 16, 2024 17:14
@jeertmans
Copy link
Owner

I rarely use Docker, but I am open to better / more reproducible ways to self-host a server. The current ltrs docker commands are quite simple, and probably not bulletproof.

Probably not be necessary, I'm just a big fan of docker compose due to the declarative style. I can just define everything that's needed from a single yaml. I'll just leave the content here for future reference in case (I'll probably come back to find this):

version: "3"

services:
  languagetool:
      image: erikvl87/languagetool:latest
      ports:
      - 8010:8010
      environment:
      - langtool_languageModel=/ngrams
      - Java_Xms=512m
      - Java_Xmx=1g
      volumes:
      - ./data:/ngrams

Nice! Is it possible to opt out of the ngrams? It is a good default, but also takes more memory I guess.

@Rolv-Apneseth
Copy link
Collaborator Author

Nice! Is it possible to opt out of the ngrams? It is a good default, but also takes more memory I guess.

I won't lie I don't know what that is as I'm not too familiar with languagetool itself, I just grabbed the default docker compose that was given for some languagetool docker image. However, reducing it to this still seems to work and allows all the tests to pass:

version: "3"

services:
  languagetool:
      image: erikvl87/languagetool:latest
      ports:
      - 8010:8010
      environment:
      - Java_Xms=512m
      - Java_Xmx=1g
docker compose up -d
LANGUAGETOOL_HOSTNAME=http://localhost LANGUAGETOOL_PORT=8010 cargo nextest run --all-features

@jeertmans
Copy link
Owner

N grams are sequences of n grammar tokens (not sure about the work) that you find in a given language and the probability to find it. The ngram dataset contains many such examples in order to help LT determine if a given sequence of words makes sense or not.

To summarize, this is an opt in feature from LT that makes error checking much better, at the cost of storing those large dataset files.

@Rolv-Apneseth
Copy link
Collaborator Author

N grams are sequences of n grammar tokens (not sure about the work) that you find in a given language and the probability to find it. The ngram dataset contains many such examples in order to help LT determine if a given sequence of words makes sense or not.

To summarize, this is an opt in feature from LT that makes error checking much better, at the cost of storing those large dataset files.

Ah ok, thanks for explaining

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration related (GitHub actions, precommit, …)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants